<template>
	<view class="tabBar">
		<view class="tabBar_list">
			<view @click="toTab('/pages/index/index')" :class="current==1?'active':''">
				<image :src="current==1?'/static/image/home-on.png':'/static/image/home-off.png'" mode="aspectFill">
				</image>
				<text>首页</text>
			</view>
			<view @click="toTab('/pages/order/order')" :class="current==2?'active':''">
				<image :src="current==2?'/static/image/list-on.png':'/static/image/list-off.png'" mode="aspectFill">
				</image>
				<text>订单</text>
			</view>
			<view @click="toTab('/pages/memberCenter/memberCenter')" :class="current==3?'active':''">
				<image :src="current==3?'/static/image/mine-on.png':'/static/image/mine-off.png'" mode="aspectFill"></image>
				<text>我的</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "tabBar",
		props: {
			current: {
				type: [String, Number],
				default: 1
			}
		},
		data() {
			return {

			};
		},
		methods: {
			toTab(event) {
				uni.reLaunch({
					url: event
				})
			}
		}
	}
</script>

<style lang="scss">
	.tabBar {
		position: fixed;
		bottom: 0;
		left: 0;
		height: 166rpx;
		width: 100%;
		z-index: 999;
		display: flex;
		align-items: center;
		box-sizing: border-box;
		border-top: 1rpx solid #B4BCC6;
		background-color: #fff;
		.tabBar_list {
			position: relative;
			z-index: 101;
			height: 120rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 100rpx;
			width: 100%;
			>view {
				display: flex;
				flex-direction: column;
				align-items: center;
				
				&:first-child{
					image{
						width: 44rpx;
						height: 44rpx;
					}
				}
				image {
					width: 40rpx;
					height: 44rpx;
					margin-bottom: 8rpx;
				}

				text {
					font-size: 34rpx;
					color: #B4BCC6;
				}

				&.active {
					text {
						color: rgba(255, 141, 26, 1);
					}
				}
			}
		}
	}
</style>